load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "liveness",
    srcs = [
        "cache.go",
        "liveness.go",
        "storage.go",
        "test_helpers.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/liveness",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/gossip",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/rpc/nodedialer",
        "//pkg/server/telemetry",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/util/buildutil",
        "//pkg/util/grpcutil",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/retry",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/syncutil/singleflight",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "liveness_test",
    size = "medium",
    srcs = [
        "client_test.go",
        "liveness_test.go",
        "main_test.go",
    ],
    embed = [":liveness"],
    exec_properties = select({
        "//build/toolchains:is_heavy": {"test.Pool": "large"},
        "//conditions:default": {"test.Pool": "default"},
    }),
    deps = [
        "//pkg/base",
        "//pkg/gossip",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/allocator/plan",
        "//pkg/kv/kvserver/liveness/livenesspb",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/server/serverpb",
        "//pkg/settings/cluster",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/testcluster",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/stop",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_kr_pretty//:pretty",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)
